#include "videoDecode.h"

class videoDecodePrivate {
public:

    bool isExit = false;

    AVCodecContext  *cc  = NULL;
    AVPacket        *pkt = NULL;
};

videoDecode::videoDecode(QObject *parent) :
    QThread(parent), d(new videoDecodePrivate)
{
}

void videoDecode::run()
{
    AVFrame *pFrame = av_frame_alloc();

    int frameFinished;
    while (!d->isExit) {
        avcodec_decode_video2(d->cc, pFrame, &frameFinished, d->pkt);
    }
}
